<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src="../../../JS/finance.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.edatagrid.js"></script>
		<script type="text/javascript" src="../../../JS/SHA-1.js"></script>
		<script type="text/javascript" src="../../../JS/addRowShareFunction.js"></script>
	</head>

	<body style="padding: 0px;">
		<div id="toolbar" class="receipts_toolbar_style"></div>
		<div>
			<div style="float: right;margin-top: 0px;max-width:60px;" id="notreview"></div>
			<form id="ff" action="#" method="post">
				<table cellpadding="5" class="displaytable" style="text-align: left;width: 80%;margin: 0 auto;">
					<tr>
						<td width="20%">
							<h id="star">* </h>配送单位</td>
						<td width="30%">
							<input class="easyui-combobox" style="width: 100%" type="text" name="CUSTOMER_NAME" id="input_CUSTOMER_NAME" data-options="disabled:true" />
						</td>
						<td width="20%">
							<h id="star">* </h>用户组</td>
						<td width="30%">
							<input class="easyui-combobox" style="width: 100%;" type="text" name="CUSTOMER_TYPE" id="input_CUSTOMER_TYPE" data-options="disabled:true">
						</td>
					</tr>
					<tr>
						<td>
							<h id="star">* </h>订单编号</td>
						<td>
							<input class="easyui-textbox" style="width: 100%;" type="text" name="ORDER_NO" id="input_ORDER_NO" data-options="prompt:'由系统自动生成，不需填写',disabled:true">
						</td>
						<td>
							<h id="star">* </h>配送时间</td>
						<td>
							<input class="easyui-datebox" style="width:100%;" type="text" name="DISTRIBUTION_DATE" id="input_DISTRIBUTION_DATE" data-options="prompt:'由系统自动生成，不需填写',disabled:true" />
						</td>
					</tr>
					<tr id="nodisplay" style="display: none">
						<td>
							<h id="star">* </h>用户组ID</td>
						<td>
							<input class="easyui-textbox" style="width:100%;" type="text" name="CUSTOMERTYPE_ID" id="input_CUSTOMERTYPE_ID" data-options="prompt:'由系统自动生成，不需填写',disabled:true" />
						</td>
						<td width="20%">
							<h id="star">* </h>配送单位编号</td>
						<td width="30%">
							<input class="easyui-textbox" style="width: 100%;" type="text" name="CUSTOMER_ID" id="input_CUSTOMER_ID" data-options="required:true,disabled:true" />
						</td>
					</tr>
					<tr>
						<td>
							<h id="star">* </h>订单状态</td>
						<td>
							<input class="easyui-textbox" style="width:100%;" type="text" name="STATE" id="input_STATE" data-options="prompt:'由系统自动生成，不需填写',disabled:true" />
						</td>
					</tr>
				</table>
				<table id="tt">

				</table>
				<div style="padding: 10px 0px;">
					<table>
						<tr>
							<th>人民币金额合计</th>
							<td>
								<input type="text" style="border: none;" name="number" />
							</td>
							<th>人民币金额合计(大写)</th>
							<td width="auto">
								<input type="text" style="border: none;" id="dx" />
								<div id="dx"></div>
							</td>
						</tr>
					</table>
				</div>
				<div style="margin-left: 20%;" id="new_footer">

				</div>
			</form>
		</div>
	</body>
	<script type="text/javascript">
		var currPage = getID(); //表示当前的页数
		var MaxPage; //最大的页数
		var MinPage; //最小的页数
		var _dataPage; //当前页面的数据
		var updateData; //获取到的更新数据
		var updateLog = ""; //更新（即删除、修改）的详细说明
		var updateIDS = new Array(); //用来保存修改之后的id
		var originalData;
		var _detailToolbarData;
		var currRow;
		getPageMaxAndMin();
		$(document).ready(function() {
			if(currPage != AddFlag && currPage != undefined) {
				loadRemote();
			}
		});

		_detailToolbarData = AddDetailToolBar(7);
		var receipts_type = RECEIPT_SAVE_SYMBOL;
		receipts_type += RECEIPT_FRONT_SYMBOL;
		receipts_type += RECEIPT_NEXT_SYMBOL;
		receipts_type += RECEIPT_DELETE_SYMBOL;
		receipts_type += RECEIPT_PRINT_SYMBOL;
		receipts_type += RECEIPT_VERIFY_SYMBOL;
		receipts_type += RECEIPT_UNVERIFY_SYMBOL;
		receipts_type += RECEIPT_SEARCH_SYMBOL;
		receipts_type += RECEIPT_EXPORT_SYMBOL;
		content = AddReceiptsToolBar(receipts_type, "");
		$('#toolbar').append(content);

		GetDetailTable();
		$('#tt').datagrid('hideColumn', 'ID');
		$('#tt').datagrid('hideColumn', 'INTERNALTRADE_ID');
		addFooter($("#new_footer"));
		//配送单位的模糊查询
		$('#input_CUSTOMER_NAME').combobox({
			valueField: 'CUSTOMER_NAME',
			textField: 'CUSTOMER_NAME',
			panelWidth: 200,
			panelHeight: 'auto',
			mode: 'remote',
			method: 'get',
			onChange: function(newValue, oldValue) {
				if(newValue != "" && newValue != undefined) {
					var url = RemoteLinkAddress + "/logistics/customer/findbypinyin?PINYINFIELDNAME=" + newValue.trim();
					$(this).combobox("reload", url);
				}
			},
			onSelect: function(record) {
				$('#input_CUSTOMER_ID').textbox('setValue', record.CUSTOMER_ID);
				$('#input_CUSTOMERTYPE_ID').textbox('setValue', record.CUSTOMERTYPE_ID);
				$('#input_CUSTOMER_TYPE').textbox('setValue', record.CUSTOMER_TYPE);
			}
		});

		function GetDetailTable() {
			$('#tt').edatagrid({
				height: 310,
				toolbar: _detailToolbarData,
				collapsible: 'true',
				singleSelect: 'true',
				rownumbers: 'true',
				fitColumns: 'true',
				showFooter: 'true',
				autoSave: 'true',
				columns: [
					[{
						field: 'ID',
						title: 'ID',
						width: '1%',
						align: 'center',
					}, {
						field: 'INTERNALTRADE_ID',
						title: '内部商品ID',
						width: '16%',
						align: 'center',
						editor: {
							type: 'textbox',
							options: {
								valueField: "INTERNALTRADE_ID",
								textField: "INTERNALTRADE_ID",
								editable: false,
								required: true
							}
						}
					}, {
						field: 'INTERNAL_NAME',
						title: '*内部商品名',
						width: '16%',
						align: 'center',
						editor: {
							type: 'combobox',
							options: {
								valueField: 'INTERNAL_NAME',
								textField: 'INTERNAL_NAME',
								panelWidth: 200,
								panelHeight: 'auto',
								mode: 'remote',
								method: 'get',
								onChange: function(newValue, oldValue) {
									if(!isEnglish(newValue)) {
										return;
									}
									if(newValue != "" && newValue != undefined) {
										var url = RemoteLinkAddress + "/logistics/internaltrade/findbypinyin?PINYINFIELDNAME=" + newValue.trim();
										$(this).combobox("reload", url);
									}
								},
								onSelect: function(record) {
									var rowIndex = $("#tt").datagrid('getRowIndex', currRow);
									var target = $('#tt').datagrid('getEditor', {
										'index': rowIndex,
										'field': 'UNIT_NAME'
									}).target;
									target.textbox('clear');
									target.textbox('setValue', record.UNIT_NAME);

									var target = $('#tt').datagrid('getEditor', {
										'index': rowIndex,
										'field': 'INTERNALTRADE_ID'
									}).target;
									target.textbox('clear');
									if(record.ID != undefined) {
										target.textbox('setValue', record.ID);
									}

									var target = $('#tt').datagrid('getEditor', {
										'index': rowIndex,
										'field': 'INTERNAL_TYPE'
									}).target;
									target.textbox('clear');
									if(record.INTERNAL_TYPE != undefined) {
										target.textbox('setValue', record.INTERNAL_TYPE);
									}

									var target = $('#tt').datagrid('getEditor', {
										'index': rowIndex,
										'field': 'UNIT_PRICE'
									}).target;
									target.textbox('clear');
									if(record.PRICE != undefined) {
										target.textbox('setValue', record.PRICE);
									}
								}
							}
						},
					}, {
						field: 'INTERNAL_TYPE',
						title: '*内部商品类型',
						width: '16%',
						align: 'center',
						editor: {
							type: 'textbox',
							options: {
								valueField: "INTERNAL_TYPE",
								textField: "INTERNAL_TYPE",
								editable: true,
								required: true
							}
						}
					}, {
						field: 'UNIT_NAME',
						title: '*单位',
						width: '16%',
						align: 'center',
						editor: {
							type: 'textbox',
							options: {
								valueField: "UNIT_NAME",
								textField: "UNIT_NAME",
							}
						}
					}, {
						field: 'AMOUNT',
						title: '*数量',
						width: '16%',
						align: 'center',
						editor: {
							type: 'numberbox',
							options: {
								required: true,
								precision: 2,
								groupSeparator: ',',
								decimalSeparator: '.',
							}
						}
					}, {
						field: 'UNIT_PRICE',
						title: '*单价',
						width: '16%',
						align: 'center',
						editor: {
							type: 'numberbox',
							options: {
								required: true,
								precision: 2, //保留两位
								groupSeparator: ',', //每组用','隔开
								decimalSeparator: '.',
								prefix: '￥' //在数据前面加￥符号
							}
						},
						formatter: function(value, row, index) {
							if(value) {
								return "￥" + value + "元";
							}
						}
					}, {
						field: 'SUM',
						title: '*总价',
						width: '16%',
						align: 'center',
						formatter: function(value, row, index) {
							if(value) {
								return "￥" + value + "元";
							}
						}
					}]
				],
				onEndEdit: function(index, row, changes) { //在编辑完成时，执行该函数
					var amount = row.AMOUNT;
					var perprice = row.UNIT_PRICE;
					var result = amount * perprice;
					$('#tt').edatagrid('updateRow', {
						index: index,
						row: {
							SUM: result.toFixed(2)
						}
					});
					$('#tt').edatagrid('refreshRow', index);
					CalSum(); //计算该页单据上的商品总和
					///当修改时触发此
					if(row.isNewRecord == false || row.isNewRecord == undefined) //即修改的情况
					{
						for(var i = 0; i < updateData.rows.length; i++) {
							if(updateData.rows[i].ID == row.ID) {
								var obj = updateData.rows[i];
								for(var s in obj) {
									if(obj[s] != row[s]) {
										updateIDS.push(row.ID);
										//确认数据有变动
										var tmp_updatelog = "[修改记录]:[品种]" + row.INTERNAL_NAME + "[" + searchOrderFieldMap(s) + "] 原值为:" + obj[s] + " 新值为:" + row[s] + ";";
										updateLog += tmp_updatelog;
										obj[s] = row[s];
									}
								}
							}
						}
					} else {
						var len = updateData.rows.length;
						updateData.rows[len] = row;
						updateData.rows[len].ORDER_ID = currPage;
						var addItem = logProcess(updateData.rows[len], "add");
						updateLog += addItem;
					}
				},
				onDestroy: function(index, row) {
					for(var i = 0; i < updateData.rows.length; i++) {
						if(updateData.rows[i].ID == row.ID) {
							sendMessageByDelDetail(row.ID, row.AMOUNT);
							updateData.rows[i].ORDER_ID = ""; //直接替换
							var removeItem = logProcess(row, "delete");
							updateLog += removeItem;
						}
					}
				},
				onDblClickRow: function(index, row) {
					currRow = row;
				},
				onAdd: function(index, row) {
					currRow = row;
				}
			});
		}

		function getPageMaxAndMin() {
			var _url = RemoteLinkAddress + "/logistics/salesorder/getmaxminid.do";
			$.ajax({ //调用ajax方法，从服务器获取到该订单的所有数据
				type: "get",
				url: _url,
				dataType: "json", //服务器返回的数据类型
				success: function(result) {
					if(result != null) {
						MaxPage = result.MAXID;
						MinPage = result.MINID;
						if(currPage == undefined || currPage == "") {
							currPage = MaxPage;
							loadRemote();
						}
					}
				}, //请求成功后，接受服务器传来的Json字符串，并做相应的处理
				error: function(xhr, status, error) {
					$.messager.alert("错误", "请求失败!");
				}
			});
		}

		///单据相关功能
		function save() {
			//保存单据
			if(_dataPage.ISVERIFY == 1) {
				$.messager.alert("警告", "订单已审核，不能修改");
				return;
			}
			getUpdateData();
		}

		function getUpdateData() {
			updateData.ORDER_ID = currPage; //当前页面的ID
			updateData.CUSTOMERTYPE_ID = $("input[name='CUSTOMERTYPE_ID']").val();
			updateData.ORDER_NO = $("input[name='ORDER_NO']").val();
			updateData.CUSTOMER_ID = $("input[name='CUSTOMER_ID']").val();
			updateData.LUMP_SUM = $("input[name='number']").val();
			updateData.DISTRIBUTION_DATE = $("input[name='DISTRIBUTION_DATE']").val();
			updateData.MEMO = $("input[name='MEMO']").val();
			updateData.LOG = updateLog;
			console.log(updateData);
			submitData(updateData);
		}

		function submitData(_data) {
			lockButton("lock");
			var _url = "";
			_url = RemoteLinkAddress + "/logistics/salesorder/update.do";
			var _senddata = JSON.stringify(_data);
			$.ajax({
				dataType: 'JSON',
				url: _url,
				data: 'a=' + _senddata,
				type: "post",
				success: function(result) {
					lockButton("unlock");
					if(currPage != AddFlag && currPage != undefined) {
						loadRemote();
					}
					var uniqueIDs = updateIDS.unique(updateIDS);
					$.messager.alert("保存", "保存成功");
					for(var i = 0; i < uniqueIDs.length; i++) {
						for(var j = 0; j < originalData.rows.length; j++) {
							if(uniqueIDs[i] == originalData.rows[j].ID) {
								$.ajax({
									dataType: 'JSON',
									url: RemoteLinkAddress + '/logistics/salesorder/findptel.do',
									data: {
										"ID": uniqueIDs[i],
										"AMOUNT": originalData.rows[j].AMOUNT
									},
									type: "post",
									success: function(result) {
										if(result.msg == "not find") {
											$.messager.alert("消息", "此条明细没有采购员，无法激发短信提示功能");
										} else {
											$.messager.confirm("修改成功", "是否向采购员" + result.NAME + "发送变更情况？", function(r) {
												if(r) {
													var buyType;
													var now = new Date();
													var nowYear = now.getFullYear();
													var nowMonth = now.getMonth() + 1;
													var nowDate = now.getDate();
													var sendData = new Object();
													//													sendData.SENDDATE = nowYear + "/" + nowMonth + "/" + nowDate;
													sendData.NAMES = result.NAME;
													if(result.FLAG == "+") {
														buyType = "多";
													} else {
														buyType = "少"
													}
													sendData.CONTEXT = "采购员" + result.NAME + "你好,你所负责采购的商品: " + result.INTERNAL_NAME + " 请" + buyType + "购买" + result.AMOUNT + result.UNIT_NAME + ",请重新确认你的购买数量！";
													sendData.TELS = result.PHONE;
													$.ajax({
														url: RemoteLinkAddress + "/phonesms/send.do",
														dataType: "JSON",
														type: "POST",
														data: sendData,
														success: function(result) {
															$.messager.alert("正确", "发送成功");
														},
														error: function(result) {
															$.messager.alert("错误", "发送失败");
														}
													})
												}
											});
										}
									},
									error: function(result) {
										$.messager.alert("错误", "保存失败");
									}
								});
							}
						}
					}
					uniqueIDs = [];
					//					$.messager.confirm("修改成功", "是否向采购员发送变更情况？", function(r) {
					//						if(r) {
					//							console.log(updateIDS);
					//						}
					//					});
				},
				error: function(result) {

					$.messager.alert("错误", "保存失败");
				}
			});
		}

		function sendMessageByDelDetail(id, amount) {
			$.ajax({
				dataType: 'JSON',
				url: RemoteLinkAddress + '/logistics/salesorder/findptel.do',
				data: {
					"ID": id,
					'AMOUNT': 0
				},
				type: "post",
				success: function(result) {
					if(result.msg == "not find") {
						$.messager.alert("消息", "此条明细没有采购员，无法激发短信提示功能");
					} else {
						$.messager.confirm("删除成功", "是否向采购员" + result.NAME + "发送变更情况？", function(r) {
							if(r) {
								var sendData = new Object();
								sendData.NAMES = result.NAME;
								sendData.CONTEXT = "采购员" + result.NAME + "你好,你所负责采购的商品: " + result.INTERNAL_NAME + "，请少购买" + result.AMOUNT + result.UNIT_NAME + ',请重新确认你的购买数量!';
								sendData.TELS = result.PHONE;
								$.ajax({
									url: RemoteLinkAddress + "/phonesms/send.do",
									dataType: "JSON",
									type: "POST",
									data: sendData,
									success: function(result) {
										$.messager.alert("正确", "发送成功");
									},
									error: function(result) {
										$.messager.alert("错误", "发送失败");
									}
								})
							}
						});
					}
				},
				error: function(result) {
					$.messager.alert("错误", "查询采购员失败");
				}
			});
		}

		function frontpage() { //上一张
			if(currPage > MinPage) {
				var _url = RemoteLinkAddress + '/logistics/salesorder/pre.do?ID=' + currPage;
				getRemoteData(_url);
			} else {
				$.messager.alert("提示", "没有上张");
			}
		}

		function nextpage() { //下一张
			if(currPage < MaxPage) {
				var _url = RemoteLinkAddress + '/logistics/salesorder/next.do?ID=' + currPage;
				getRemoteData(_url);
			} else {
				$.messager.alert(" 提示", "没有下张");
			}
		}

		function deletedata() { //删除

			if(_dataPage.ISVERIFY == 1) {
				$.messager.alert("提示", "该单据已审核，不能删除！");
				return;
			}
			$.messager.confirm('Confirm', '是否删除此单据', function(r) {
				if(r) {
					$.post(RemoteLinkAddress + "/logistics/salesorder/delete.do", {
							ID: currPage,
						},
						function(result) {

							if(result.msg == "success") {
								$('#tt').datagrid('reload'); // reload the user data
								$.messager.alert({ // show success message
									title: '成功',
									msg: '删除成功'
								});
								nextpage();
							} else {
								$.messager.alert({ // show error message
									title: 'Error',
									msg: result.msg
								});
							}
						},
						'json');
				}
			});
		}

		function verifydata() { //审核单据
			var a = checkDataIntegrity();
			if(a == 0) {
				$.messager.alert("失败", "请将页面中的数据补充完整后再进行审核！");
				return;
			}
			if(_dataPage.ISVERIFY == 1) {
				$.messager.alert("提示", "该订单已通过审核！无需再审核！");
				return;
			}
			var _url = RemoteLinkAddress + "/logistics/salesorder/verify.do";
			$.ajax({
				dataType: 'JSON',
				url: _url,
				data: {
					ID: currPage
				},
				type: "POST",
				success: function(result) {
					$.messager.alert("成功", "审核成功");
					_dataPage.ISVERIFY = "1";
					verifyStatus(_dataPage.ISVERIFY, true);
				},
				error: function(result) {
					$.messager.alert("失败", "审核失败");
				}
			});
		}

		function unverifydata() { //弃审单据
			if(_dataPage.ISVERIFY == 0) {
				$.messager.alert("提示", "该订单已弃审！无需再弃审！");
				return;
			}
			// if(_dataPage.STATE !== '下单'){
			// 	$.messager.alert("提示", "该单据已进入下一流程，不能弃审");
			// 	return;
			// }
			$.messager.confirm("警告", "你确认要弃审该条单据吗", function(r) {
				if(r) {
					var _url = RemoteLinkAddress + "/logistics/salesorder/unverify.do";
					$.ajax({
						dataType: 'JSON',
						url: _url,
						data: {
							ID: currPage,
						},
						type: "POST",
						success: function(result) {
							$.messager.alert("成功", "弃审成功");
							_dataPage.ISVERIFY = "0";
							verifyStatus(_dataPage.ISVERIFY, true);
						},
						error: function(result) {
							$.messager.alert("失败", "弃审失败");
						}
					});
				}
			});
		}

		function searchmore() { //查询单据
			AddTabIn("销售订单查询", parent.$('#tabs'), "UI/LOGISTICS/SellOrder/SellOrderSearch.html");
		}

		function print() { //打印单据
			if(_dataPage.ISVERIFY == 0) {
				$.messager.alert("警告", "订单未审核不能打印");
				return;
			}
			if(currPage == AddFlag) {
				$.messager.alert('警示', "当前页面为新增页面，不可打印！");
				return;
			}
			var pLocation = "";
			pLocation = "SellOrderPrint.html?id=" + currPage;
			window.open(pLocation);
		}

		function loadRemote() {
			var _url = RemoteLinkAddress + '/logistics/salesorder/findbyid.do?ID=' + currPage;
			getRemoteData(_url);
		}

		function getRemoteData(_url) //统一获取远程的数据
		{
			$.ajax({ //调用ajax方法，从服务器获取到该订单的所有数据
				type: "get",
				url: _url,
				dataType: "json", //服务器返回的数据类型
				success: function(result) {
					if(result != null) {
						_dataPage = result;
						verifyStatus(result.ISVERIFY, true); //判断当前页面的审核状态
						updateData = deepCopy(result);
						originalData = deepCopy(result);
						getFormData(result);
						currPage = result.ID; //表示传回的ID
						var _data = result.rows;
						$('#tt').edatagrid('loadData', _data);
						updateLog = "";
						CalSum();

					}
				},
				error: function(xhr, status, error) {
					$.messager.alert("错误", "请求失败!");
				}
			});
		}

		function CalSum() {
			var _num = 0;
			var dataGridRows = $("#tt").datagrid("getRows");
			for(var i = 0; i < dataGridRows.length; i++) {
				if(dataGridRows[i].INTERNAL_NAME != undefined) {
					_num += parseFloat(dataGridRows[i].SUM);
				}
			}
			var num = changeMoneyToChinese(_num);
			$("#dx").val(num);
			$("input[name='number']").val(_num.toFixed(2));
		}

		function logProcess(data, type) {
			var str = "";
			switch(type) {
				case "add":
					str = "[新增记录]:";
					break;
				case "delete":
					str = "[删除记录]:";
					break;
			}
			for(var s in data) {
				if(searchOrderFieldMap(s) != undefined) {
					str += searchOrderFieldMap(s) + ":" + data[s] + " ";
				}
			}
			str += ";";
			return str;
		}

		function checkDataIntegrity() {
			var rowsdata = $("#tt").datagrid('getRows');
			if(rowsdata.length != 0) {
				for(var i = 0; i < rowsdata.length; i++) {
					var internaltype = rowsdata[i].INTERNAL_TYPE;
					var internalname = rowsdata[i].INTERNAL_NAME;
					var unitname = rowsdata[i].UNIT_NAME;
					var unitprice = rowsdata[i].UNIT_PRICE;
					var amount = rowsdata[i].AMOUNT;
					var sum = rowsdata[i].SUM;
					if(internalname == "" || internaltype == "" || unitname == "" || amount == "") {
						return 0;
					}
				}
			} else {
				return 0;
			}
		}

		function exportExcel() {
			if(_dataPage.ISVERIFY == 0) {
				$.messager.alert("警告", "订单未审核，不能导出");
				return;
			}
			if(currPage === AddFlag) {
				$.messager.alert("警告", "该订单为新增订单，无法导出Excel！");
				return;
			}
			$.messager.confirm("提示", "确认导出Excel表格吗？", function(r) {
				if(r) {
					$.ajax({ //调用ajax方法，从服务器获取到该订单的所有数据
						type: "get",
						dataType: "json", //服务器返回的数据类型
						url: RemoteLinkAddress + "/logistics/salesorder/excelorder.do",
						data: {
							"ID": currPage
						},
						success: function(result) {
							window.location.href = result.path;
						}, //请求成功后，接受服务器传来的Json字符串，并做相应的处理
						error: function(xhr, status, error) {
							$.messager.alert("错误", "请求失败!");
						}
					});
				}
			});
		}
	</script>

</html>